# 导包
import jsonschema
# 创建数据
a= 13437
str1 = "i2e7rfsg2832tf"
dict1 = {"type":"age"}
list1 = [1, 1, 4, 4]
float1 = 315.34
b = None
bool1 = True

# 定义规则
schema1 = {"type":"integer"}
schema2 = {"type":"string"}
schema3 = {"type":"object"}
schema4 = {"type":"array"}
schema5 = {"type":"number"}
schema6 = {"type":"null"}
schema7 = {"type":"boolean"}


print(jsonschema.validate(instance=a,schema=schema1))
print(jsonschema.validate(instance=str1,schema=schema2))
print(jsonschema.validate(instance=dict1,schema=schema3))
print(jsonschema.validate(instance=list1,schema=schema4))
print(jsonschema.validate(instance=float1,schema=schema5))
print(jsonschema.validate(instance=b,schema=schema6))
print(jsonschema.validate(instance=bool1,schema=schema7))
